package com.example.demo1.maper;

import java.util.List;

import com.example.demo1.model.Category;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CategoryMapper {

    @Select("Select * from categories")
    List<Category> queryAll();

    @Select("Select name from categories where name = #{name}")
    public Category queryByName(String name);

    @Insert("insert into categories (parentid,name,createTime) values (#{parentid},#{name},#{createTime})")
    int inset(Category category);

}
